#ifndef GLOBALHOOK_H
#define GLOBALHOOK_H
#include <windows.h>
#include <QObject>
#include <QDebug>

class GlobalHook:public QObject
{
    Q_OBJECT
public:
    enum Model
    {
        eNull = 0,         // 空模式，不捕获
        eKey = 1,          // 键盘钩子模式
        eMouse = 2,        // 鼠标钩子模式
        eMouseKey = 3      // 键盘和鼠标钩子模式
    } mModel;

    GlobalHook();
    void installHook(Model model);
    void unInstallHook(Model model);
    void sendSignal(int key);

private:


signals:
    void keyEventReceived(int vkCode);
    void mouseEventReceived(int x, int y, QString button);
};

#endif // GLOBALHOOK_H
